package biz

import "golang.org/x/net/context"

type Product struct {
	Id string
	Name string
	Description string
	Price float32
}

type ProductRepo interface {
	CreateProduct(ctx context.Context, p *Product) (*Product, error)
	GetProduct(ctx context.Context, p *Product) (*Product, error)
}

type ProductUseCase struct {
	repo ProductRepo
}

func NewProductUseCase(repo ProductRepo) *ProductUseCase {
	return &ProductUseCase{repo: repo}
}

func (p *ProductUseCase) AddProduct(ctx context.Context, product *Product) (*Product, error) {
	return p.repo.CreateProduct(ctx, product)
}

func (p *ProductUseCase) GetProduct(ctx context.Context, product *Product) (*Product, error)  {
	return p.repo.GetProduct(ctx, product)
}

